import { observable, action, toJS } from "mobx";
import isEqual from "lodash/isEqual";
import isEmpty from "lodash/isEmpty";
import { message, Modal } from "antd";
import Apis from "../apis/myBlog";
import WeaUtils from "../components/Component/wea-utils";
import {WeaTableNew, WeaForm} from 'comsMobx';
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
const { GetRegex, DateFormat } = WeaUtils;
const Base64 = ecCom.WeaTools.Base64;

export default class MyBlog {
    @observable loading = false;
    @observable userList = [];
    @observable disabled = false;
    @observable isNoTip =false;
    @observable
    status = {
        title: getLabel(26468, "我的微博"),
        loading: false,
        keyWords: "",
        userInfo: {},
        weiboGroup: {},
        weiboCKEditorConfig: {},
        currentParams: {}, //当前搜索条件,用于判断返回的数据是否为搜索数据
        indexInfo: {},
        basicInfo: {},
        receiverList: {},
        visitorList: {},
        weiboList: {},
        fanList: {},
        attentionList: {},
        shareToMeUserList: {},
        messageList: {},
        note: {},
        defaultTemplate: {},
        WeaRichTextStoreValue: {},
        richInit: true,
        atList: [],
        curUserid: "",
        gzbrowsercondition:'',
        bacthAttentionDisabled:false
    };


    @observable
    notetime = 60000;

    @observable
    notetiming = 0;

    @observable
    caogao ="";

    changeCaoGao = (val) => {
        this.caogao=val;
    }

    setIsNoTip = (val) =>{
       this.isNoTip=val;
    }


    @observable
    showUserTitle = getLabel(525741,'可见人员');

    @observable
    discussShareUserList = [];

    @observable
    shareUserListVisible = false


   @observable
   changeDiscussShareUserList = () => {
       this.discussShareUserList = [];
   }



   @observable
   blogid = '';


    @observable
    changeShareUserListVisible = (val,blogid) => {

        if(blogid){
            this.blogid=blogid;
    Apis.getCheckedUserList({blogId:blogid}).then(result => {

        if(result.shareType=="3"){
            this.showUserTitle = getLabel(525741,'可见人员') ;
        }else {
            this.showUserTitle = getLabel(525742,'不可见人员')  ;
        }

      this.discussShareUserList = result.ulist;
        this.shareUserListVisible = val;
    })
        }else{
            this.discussShareUserList = [];
            this.shareUserListVisible = val;
        }
    }


    @observable
    onSeachShareUserList = (val) => {

        if(this.blogid){
            Apis.getCheckedUserList({blogId:this.blogid,searchValue:val}).then(result => {
                this.discussShareUserList = result.ulist;
                if(result.shareType=="3"){
                    this.showUserTitle = getLabel(525741,'可见人员') ;
                }else {
                    this.showUserTitle = getLabel(525742,'不可见人员')  ;
                }
            })
        }
    }




    @observable
    specialCount= 0

    @observable
    allCount= 0

    @observable
    bqvisibleDialog = false;

    @observable
    bqshowEdit = true;

    @observable
    bqediting = true;

    @observable
    bqfbworkdate = "";




    @observable
    isSpecial = false;


    @observable
    showViewMyBlogVisible = false;


    @observable
    shareDiscussId =""

    @action
    changeShowViewMy = (val) => {
        if(!val){
            this.shareType="1";
            this.replaceDatas=[];
        }

    }


    @observable
    shareType = "1";

    @observable
    replaceDatas=[];

    @observable
    shareContent ="";

    @action
    changeShareContent = (ids) => {
        this.shareContent=ids;
    }


    @action
    changeReplaceDatas = (datas) => {
        this.replaceDatas = datas;
    }

    @action
    changeShareType = (type) => {
        this.shareType=type;
    }


    @action
    getInfoShare = (discussid) => {

        this.shareDiscussId=discussid;
        Apis.getShareInfo({discussid:discussid}).then((res)=> {
            if(res.shareType=="3"||res.shareType=="4"){
                this.replaceDatas=res.replaceDatas;
                this.shareContent=res.shareContent;
            }
            this.shareType =res.shareType;
        })
    }



    @action
    saveBlogDiscussShare = (params) => {

        if((params.shareType=='3'||params.shareType=='4')&&this.shareContent==""){
            message.error("人员不能为空");
            return;
        }
        params.content = this.shareContent;
        message.loading('正在提交中...', 20);
            Apis.saveShareInfo(params).then((res) => {
               if(res.pd){
                   message.destroy();
                   message.success(getLabel('83885',"操作成功！"));
                   this.showViewMyBlogVisible= false;
                   this.shareType="1";
               }else{
                   message.destroy();
                   message.error(getLabel(507224,"微博启用时间未设置，不能填写微博"));
                   this.showViewMyBlogVisible= false;
               }
            })
    }





//建模新加 以下




    changeBqVisDiaLog =(val,workdate) =>{
        this.bqvisibleDialog = val;
        this.bqfbworkdate=workdate;
    }




    changeEdit = (showEdit,editing) => {
        this.bqshowEdit = showEdit;
        this.bqediting = editing;
    }


    @observable
    richTextVisibleDialog = false;

    @observable
    richTextShowEdit = true;

    @observable
    richTextEditing = true;

    @observable
    richTextFbworkdate = "";

    @observable
    richTextContent = "";


    changeRichTextEdit = (showEdit,editing) => {
        this.richTextEditing = editing;
        this.richTextShowEdit = showEidt;
    }



changeRichTextDia = (val) => {

    this.richTextVisibleDialog=val;
    if(val==false){
        this.richTextContent="";
        this.cubeLayoutParame={};
    }
}



    changeRichTextVisDiaLog = (val,workdate,id) => {
        this.richTextVisibleDialog=val;
        if(val==false){
            this.richTextContent="";
            this.cubeLayoutParame={};
        }
        this.richTextFbworkdate=workdate;
        this.ecmeid = id;
    }

    @observable
    isenableecme = "0";

    @observable
    ecmevisibleDialog = false;

    @observable
    ecmefbworkdate = "";

    @observable
    cubeLayoutParame = {};

    @observable
    defaultCubeLayoutParame = {};

    @observable
    ecmeid = "";

    @observable
    Card ={}


    @observable
    ecmeMood="1"

    changeEcmeMood = (val) =>{
        this.ecmeMood = val;
    }

    @observable
    partid = 0;


    changePartId = (id)=>{
        this.partid=id;
    }

    @observable
    oneecomespinning = true;
    @observable
    ecmedialogspinning

    changeOneEcmespin = (val) => {
        this.oneecomespinning = val
    }





    getCardStorefun = (store)=>{
        this.Card = store;
    }


    changeEcmedilogspin = (val) => {
        this.ecmedialogspinning = val;
    }

    changeEcmeVisible = (val) => {

        this.ecmevisibleDialog=val;
    }


    changeEcmeVisDiaLog = (val,workdate,ecmeid) => {
        this.ecmevisibleDialog = val;

        if(val==false){
            this.cubeLayoutParame={};
            this.richTextContent="";
        }
        else{
            this.ecmefbworkdate=workdate;
            this.ecmeid=ecmeid;
        }
    }



    changeRichOrEcme = (type,content,id) => {

        if(type==0){
            this.richTextContent=content;
        }else {
            this.cubeLayoutParame=content;
            this.partid=id;

        }

    }



    getBlogWeiConEcmeInfo = (params,callback) => {
        if(params.partid&&params.partid>0){
            this.partid = params.partid;
        }

        Apis.getBlogEcmeInfo(params)
            .then((result) => {
                if(params.partid==0){
                    this.richTextContent=result.content;
                }else{

                    this.partid = result.partid;
                    if(callback)callback(result)
                }

            })
            .catch(error => {
                message.error(error);
            });
    }


    getBlogEcmeInfo = (params) => {
        if(params.partid&&params.partid>0){
            this.partid = params.partid;
        }

        Apis.getBlogEcmeInfo(params)
            .then((result) => {
                if(params.partid==0){
                    this.richTextContent=result.content;
                }else{
                    this.cubeLayoutParame=result.data;
                }

            })
            .catch(error => {
                message.error(error);
            });
    }

    getBlogNoteEcmeinfo = (params,callback = false) => {
        Apis.getBlogNoteEcmeinfo(params).then((result) => {
            if (callback) callback(result);
        })
    }

    saveBlogEcmeInfo = (params,callback = false) => {
        message.loading('正在提交中...', 20);
        Apis.saveBlogEcmeinfo(params).
        then( (result) => {
            this.cubeLayoutParame={};
            if (result.status) {
                let copyresult = { ...result };
                if (copyresult.blogDiscussVo.content) {
                    let decodeContent = Base64.decode(
                        copyresult.blogDiscussVo.content
                    );
                    result.blogDiscussVo = {
                        ...copyresult.blogDiscussVo,
                        content: decodeContent
                    };
                }

                if (
                    copyresult.blogDiscussVo.blogReplyList &&
                    copyresult.blogDiscussVo.blogReplyList.length > 0
                ) {
                    copyresult.blogDiscussVo.blogReplyList.forEach(
                        (_record, _index) => {
                            let decodeContentReply = Base64.decode(_record.content);
                            result.blogDiscussVo.blogReplyList[_index] = {
                                ..._record,
                                content: decodeContentReply
                            };
                        }
                    );
                }

                let others = {};
                if(!result.istodaymany){
                    if(result.isNew){
                        others.workdate = params.workdate;
                    }else{
                        others.discussId=result.blogDiscussVo.id;
                    }
                }else{
                    others.istodaymany=result.istodaymany;
                }
                this.replaceWeiboList(
                    others,
                    "",
                    "blogDiscussVo",
                    this.status,
                    result,
                    "",
                    () => {callback(result);
                        this.disabled = false;
                        message.destroy();
                        message.success(getLabel('83885',"操作成功！"));
                    }
                );
                this.getIndexInfo(); // 刷新指数
            } else {
                message.destroy();
                message.error(getLabel(507224,"微博启用时间未设置，不能填写微博"));
            }


            callback(result);
        })
    }


    saveBlogNoteEcmeinfo = (params,callback = false) => {

        Apis.saveBlogNoteEcmeinfo(params).
        then( (result) => {
            this.disabled = false;
            callback(result);
        })
    }


    updateBlogEcmeinfo = (params,callback = false) => {
        Apis.updateBlogEcmeinfo(params).then((result)=>{
            message.loading('正在提交中...', 20);
            this.richTextContent="";
            this.cubeLayoutParame={};
            if (result.status) {
                let copyresult = { ...result };
                if (copyresult.blogDiscussVo.content) {
                    let decodeContent = Base64.decode(
                        copyresult.blogDiscussVo.content
                    );
                    result.blogDiscussVo = {
                        ...copyresult.blogDiscussVo,
                        content: decodeContent
                    };
                }

                if (
                    copyresult.blogDiscussVo.blogReplyList &&
                    copyresult.blogDiscussVo.blogReplyList.length > 0
                ) {
                    copyresult.blogDiscussVo.blogReplyList.forEach(
                        (_record, _index) => {
                            let decodeContentReply = Base64.decode(_record.content);
                            result.blogDiscussVo.blogReplyList[_index] = {
                                ..._record,
                                content: decodeContentReply
                            };
                        }
                    );
                }

                    let others={};
                others.discussId=result.blogDiscussVo.id;
                this.replaceWeiboList(
                    others,
                    "",
                    "blogDiscussVo",
                    this.status,
                    result,
                    "",
                    () => {callback(result);
                        message.destroy();
                        message.success(getLabel('83885',"操作成功！"));
                        this.disabled = false;
                    }
                );

            } else {
                message.destroy();
                message.error(getLabel(507224,"微博启用时间未设置，不能填写微博"));
            }


            callback(result);



        })

    }


//建模新加 以上





    @observable
    isBlogNote ="1";

    @observable
    searchAdForShareTable = {
        form: new WeaForm(),
        show: false,
        conditioninfo: []
    };
    myBolgParam = {}

    doInit = (parms) => {
        // if(parms!=1){
        //   return ;
        // }
        this.searchAdForShareTable = {
            ...this.searchAdForShareTable,
            form: new WeaForm(),
            show: false,
        }
        this.getSearchCondition();
    };

    doExeclMyBolgParamInit = (params)=>{
        this.myBolgParam = params;
    }

    getSearchConditionByGroupIdInit = (params) => {
        this.searchAdForShareTable = {
            ...this.searchAdForShareTable,
            form: new WeaForm(),
            show: false,
        }
        this.getSearchConditionByGroupId(params);
    };

    @observable groupDialogForm = new WeaForm(); //新建、编辑分组信息
    @observable
    moduleStatus = {
        showGroupCreate: false,
        createOrEdit: 'create',
        editKey: -1,
        groupDialogFields: []
    }

    constructor() {}
    @action
    setDisabled = (val) =>{
        this.disabled = val;
    }
    @action
    addUser(params) {
        this.userList.push({ name: "dyf" });
    }
    saveWeaRichTextValue = (objs, para = true) => {
        let WeaRichTextStoreValue = {
            ...this.status.WeaRichTextStoreValue,
            ...objs
        };
        this.status = {
            ...this.status,
            WeaRichTextStoreValue: WeaRichTextStoreValue,
            richInit: para
        };
    };
    saveWeaRichTextValueOther = objs => {
        let WeaRichTextStoreValue = {
            ...this.status.WeaRichTextStoreValue,
            ...objs
        };
        this.status = {
            ...this.status,
            WeaRichTextStoreValue: WeaRichTextStoreValue
        };
    };
    getUserList(params) {
        return this.userList.slice();
    }
    MYBLOG_LOADING = (loading, currentParams) => {
        this.status = {
            ...this.status,
            loading: loading,
            currentParams: currentParams
        };
        // return {...state, loading: action.loading, currentParams: action.currentParams}
    };
    USER_INFO = () => {
        this.status = { ...this.status, userInfo: loading };
    };



    addWeiboList = (data,callback=false) => {
        let weiboList =this.status.weiboList;
        weiboList = toJS(weiboList);
        let newWeiboList = [...toJS(weiboList.discussList)];
        newWeiboList.unshift(data);
        weiboList = { ...weiboList, discussList: newWeiboList };
        this.status = { ...this.status, weiboList: weiboList };
        if(callback) callback;
    }


    replaceWeiboList = (
        others,
        _old,
        _new,
        status,
        data,
        setReaded = "",
        callback = false
    ) => {
       
        let weiboList = { ...status.weiboList };
        weiboList = toJS(weiboList);
        // let newWeiboList = toJS(weiboList.discussList);
        let newWeiboList = [...toJS(weiboList.discussList)];
        data = toJS(data);
       
        if (setReaded == "setReaded") {
            //为了优化性能，未读设置为已读操作单独抽出来
            if (newWeiboList && newWeiboList.length > 0) {
                newWeiboList.forEach((item, key) => {
                    if (others.discussId) {
                        if (
                            item.id == others.discussId &&
                            others.discussId == data.discussId
                        ) {
                            // newWeiboList[key] = data[_new]
                            // let a = Base64.decode(newWeiboList[key].content)
                            newWeiboList[key] = {
                                ...newWeiboList[key],
                                isShowReadOrUnread: data.isShowReadOrUnread,
                                isReaded: data.isReaded
                                // content:a
                            };
                        }
                    }
                });
            }
        } else if(others.istodaymany){
            newWeiboList.unshift(data.blogDiscussVo);
        }else {
         

            if (newWeiboList && newWeiboList.length > 0) {
                newWeiboList.forEach((item, key) => {

                    if (others.discussId) {

                        if (item.id == others.discussId && others.discussId!="0") {

                            if (_old) newWeiboList[key][_old] = data[_new];
                            else newWeiboList[key] = data[_new];

                        }else{
                            if (others.discussId=="0") {
                                if (item.workdate == others.workdate) {

                                    if (_old) newWeiboList[key][_old] = data[_new];
                                    else newWeiboList[key] = data[_new];
                                }
                            }
                        }
                    } else {
                        if (others.userId) {



                            if (others.discussId!="0"&&others.discussId!=undefined&& item.userid == others.userId) {
                                if (_old) newWeiboList[key][_old] = data[_new];
                                else newWeiboList[key] = data[_new];
                            }else if(item.workdate == others.workdate && item.userid == others.userId){
                                if (_old) newWeiboList[key][_old] = data[_new];
                                else newWeiboList[key] = data[_new];
                            }
                        } else {
                            if (item.workdate == others.workdate) {
                                if (_old) newWeiboList[key][_old] = data[_new];
                                else newWeiboList[key] = data[_new];
                            }
                        }
                    }
                    return;
                });
            } else {
                newWeiboList.push(data[_new]);
            }
        }
        weiboList = { ...weiboList, discussList: newWeiboList };
        this.status = { ...this.status, weiboList: weiboList };
        if (callback) callback();
        // setTimeout(()=>{},1000)
    };

    getAtList = (params) => {
        Apis.getAtList(params)
            .then(result => {
                if(result.isBlogNote!=undefined){
                    this.isBlogNote = result.isBlogNote;
                }
                this.status = { ...this.status, atList: result.atList, curUserid: result.curUserid };
            })
            .catch(error => {
                message.error(error);
            });
    }

    init = (type = 21,pms) => {

        // this.getAtList();
        // this.getFilterIds();
        let others = { type: type, status: true },
            params = { endDate: DateFormat(new Date(), "yyyy-MM-dd") };
        if(type==11){
            params = {currentPage: 1, groupId: "1"};
        }
        if(type==12){
            params = {currentPage: 1};
        }
        if(type==22){
            params = pms;
        }

        let currentParams = {
            ...params,
            _func: "getWeiboList",
            _otherType: others.type
        };


        let p1 = Apis.getUserInfo();
        let p3 = Apis.getMessageList();
        let p4 = Apis.getDefaultTemplate();
        let p5 = Apis.getNote();
        let p6 = Apis.getWeiboCKEditorConfig();
        let p7 = Apis.getWeiboList(params);

        if(type==11){
            p7 = Apis.getWeiboMainPageList(params);
        }
        if(type==12){
            p7 = Apis.getWeiboMainPageNewList(params);
        }
        if(type==22){
            p7 = Apis.getWeiboEveryTypeList(params);
        }

        this.MYBLOG_LOADING(true, currentParams);
        Promise.all([p1, p3, p4, p5, p6, p7]).then(result => {
            if (isEqual(this.status.currentParams, currentParams)) {
                // return
                result[5].__hasData =
                    result[5].total &&
                    result[5].currentPage * result[5].pageSize <= result[5].total;
                if (others.type == 12 || others.type == 21) {
                    result[5].__hasData = result[5].discussList
                        ? !!result[5].discussList.length
                        : false;
                }
                if (!others.status) {
                    let resultDiscussList = result[5].discussList || [];
                    result[5].discussList =
                        result[5].currentPage == 1
                            ? result[5].discussList
                            : [...this.status.weiboList.discussList, ...resultDiscussList];
                }
                let copyresult6 = { ...result[5] };
                copyresult6.discussList && copyresult6.discussList.forEach((record, index) => {
                    if (record.content) {
                        let decodeContent = Base64.decode(record.content);
                        result[5].discussList[index] = {
                            ...record,
                            content: decodeContent
                        };
                    }
                    if (record.blogReplyList && record.blogReplyList.length > 0) {
                        record.blogReplyList.forEach((_record, _index) => {
                            let decodeContentReply = Base64.decode(_record.content);
                            result[5].discussList[index].blogReplyList[_index] = {
                                ..._record,
                                content: decodeContentReply
                            };
                        });
                    }
                });
                let real = result[2];
                if (!isEmpty(result[2].defaultTemplate)) {
                    if(result[2].isenableecme=="1"){
                        this.isenableecme ="1";
                        this.defaultCubeLayoutParame=result[2].data;
                        this.partid=result[2].partid;
                    }else{
                        this.isenableecme ="0";
                        let tempContent = Base64.decode(
                            result[2].defaultTemplate.tempContent
                        );
                        let defaultTemplate = {
                            ...result[2].defaultTemplate,
                            tempContent: `${tempContent}`
                        };
                        real = { ...result[2], defaultTemplate: defaultTemplate };
                    }
                }else {
                    this.isenableecme ="0";
                }
                let decodeContent = Base64.decode(result[3].content);
                let copy = { ...result[3], content: decodeContent };
                if(result[4].isBlogNote){
                    this.isBlogNote = result[4].isBlogNote;
                }



                this.status = {
                    ...this.status,
                    userInfo: result[0],
                    messageList: result[1],
                    defaultTemplate: real,
                    note: copy,
                    weiboCKEditorConfig: result[4],
                    weiboList: result[5],
                    loading: false,
                    keyWords: ""
                };
            }
        });
    };

//应内容导出
    myBlogExport = () => {
        this.myBolgParam["isMyBlog"] = "isMyBlog";
        Apis.myBlogExport(this.myBolgParam).then(result => {
            window.location="/weaver/weaver.file.ExcelOut";
        });
    };

    // 表格高级搜索
    getSearchCondition = () => {
        Apis.getBlogPageSearchCondition().then(res => {
            this.searchAdForShareTable.form.initFormFields(res.conditioninfo);
            this.searchAdForShareTable.conditioninfo = res.conditioninfo;
        });
    };

    // 表格高级搜索
    getSearchConditionByGroupId = params => {
        Apis.getBlogPageSearchCondition(params).then(res => {
            this.searchAdForShareTable.form.initFormFields(res.conditioninfo);
            this.searchAdForShareTable.conditioninfo = res.conditioninfo;
        });
    };

    setKeywords = v => {
        this.status = { ...this.status, keyWords: v };
    };

    doLoading = loading => {
        this.status = { ...this.status, loading: loading };
    };

    getWeiboCKEditorConfig = params => {
        Apis.getWeiboCKEditorConfig(params)
            .then(result => {
                this.status = { ...this.status, weiboCKEditorConfig: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    getUserInfo = params => {
        Apis.getUserInfo(params)
            .then(result => {
                this.status = { ...this.status, userInfo: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    getDefaultTemplate = params => {
        Apis.getDefaultTemplate(params)
            .then(result => {
                this.status = { ...this.status, defaultTemplate: result };
                this.isenableecme = result.isenableecme;
            })
            .catch(error => {
                message.error(error);
            });
    };



    getEcmeTemlate = (params,callback =false) => {
        Apis.getDefaultTemplate(params)
            .then(result => {
                if(callback)callback(result);

            })
    }

    getWeiboGroup = params => {
        Apis.getWeiboGroup(params)
            .then(result => {
                this.status = { ...this.status, weiboGroup: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    getIndexInfo = params => {
        Apis.getIndexInfo(params)
            .then(result => {
                this.status = { ...this.status, indexInfo: result };

            })
            .catch(error => {
                message.error(error);

            });
    };

    getBasicInfo = params => {
        Apis.getBasicInfo(params)
            .then(result => {
                this.status = { ...this.status, basicInfo: result };
                // this.disabled = false;
            })
            .catch(error => {
                message.error(error);
                // this.disabled = false;
            });

    };


    getReceiverList = params => {
        Apis.getReceiverList(params)
            .then(result => {
                this.status = { ...this.status, receiverList: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    getVisitorList = params => {
        Apis.getVisitorList(params)
            .then(result => {
                this.status = { ...this.status, visitorList: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    MYBLOG_CLEAR_COMMENT_COUNT = () => {
        if (!this.status.basicInfo || !this.status.basicInfo.countData) {
            // return ;
            this.status = { ...this.status };
        } else {
            let basicInfo = { ...this.status.basicInfo };
            basicInfo.countData = { ...basicInfo.countData, commentCount: 0 };
            // return {...this.status, basicInfo: basicInfo};
            this.status = { ...this.status, basicInfo: basicInfo };
        }
    };

    getWeiboList = (others, params) => {
        let currentParams = {
            ...params,
            _func: "getWeiboList",
            _otherType: others.type
        };
        this.MYBLOG_LOADING(true, currentParams);
        if (others.type == 22) {
            // dispatch({type: types.MYBLOG_CLEAR_COMMENT_COUNT,  data: {status: 1}});
            this.MYBLOG_CLEAR_COMMENT_COUNT();
        }
        let response = null;
        switch (others.type * 1) {
            case 10: //分组为空
                response = Apis.getAllWeiboMainPageList(params);
                break;
            case 11:
                response = Apis.getWeiboMainPageList(params);
                break;
            case 12:
                response = Apis.getWeiboMainPageNewList(params);
                break;
            case 13: //分享给我
                response = Apis.getWeiboPageShareToMeList(params);
                break;
            case 21:
                response = Apis.getWeiboList(params);
                break;
            default:

                let type = others.type * 1;
                if(type==22){
                    params.type='reply';
                }else if(type==23){
                    params.type='zan';
                }else  if(type==24) {
                    params.type='at';
                }
                response = Apis.getWeiboEveryTypeList(params);
                break;
        }
        response
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });

                    result.__hasData =
                        result.total &&
                        result.currentPage * result.pageSize <= result.total;
                    if (others.type == 12 || others.type == 21) {
                        result.__hasData = result.discussList
                            ? !!result.discussList.length
                            : false;
                    }

                    if (!others.status) {
                        // result.discussList = result.currentPage == 1 ? result.discussList : this.status.weiboList.discussList.concat(result.discussList || [])
                        let resultDiscussList = result.discussList || [];
                        if (resultDiscussList.length > 0) {
                            result.discussList =
                                result.currentPage == 1
                                    ? result.discussList
                                    : [
                                        ...this.status.weiboList.discussList,
                                        ...resultDiscussList
                                    ];
                        } else {
                            result.discussList =
                                result.currentPage == 1
                                    ? result.discussList
                                    : [...this.status.weiboList.discussList];
                        }
                    }

                    this.status = {
                        ...this.status,
                        weiboList: result,
                        loading: false,
                        keyWords: ""
                    };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };

    searchWeiboList = params => {
        let currentParams = { ...params, _func: "searchWeiboList" };
        this.MYBLOG_LOADING(true, currentParams);
        Apis.searchWeiboList(params)
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });
                    // return ;

                    if(result.total==result.discussList.length||result.discussList.length>result.total){
                        result.__hasData = false;
                    }else{
                        result.__hasData = result.discussList
                            ? !!result.discussList.length
                            : false;
                    }


                    if (result.currentPage == 1) {
                        result.discussList = result.discussList;
                    } else {
                        // result.discussList = result.weiboList.discussList.concat(result.discussList || [])
                        if (result.discussList.length > 0) {
                            let others = result.discussList;
                            result.discussList = [
                                ...this.status.weiboList.discussList,
                                ...others
                            ];
                        } else {
                            result.discussList = [...this.status.weiboList.discussList];
                        }
                    }

                    this.status = { ...this.status, weiboList: result, loading: false };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };

    searchWeiboMainPageList = params => {
        //ok
        let currentParams = { ...params, _func: "searchWeiboMainPageList" };
        this.MYBLOG_LOADING(true, currentParams);
        Apis.searchWeiboMainPageList(params)
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });

                    result.__hasData = result.discussList
                        ? !!result.discussList.length
                        : false;
                    if (result.currentPage == 1) {
                        result.discussList = result.discussList;
                    } else {
                        let others = result.discussList || [];
                        result.discussList = [
                            ...this.status.weiboList.discussList,
                            ...others
                        ];
                    }
                    this.status = { ...this.status, weiboList: result, loading: false };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };

    searchUnreadWeiboMainPageList = params => {
        //ok
        let currentParams = { ...params, _func: "searchUnreadWeiboMainPageList" };
        this.MYBLOG_LOADING(true, currentParams);
        Apis.getWeiboMainPageNewList(params)
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });

                    result.__hasData = result.discussList
                        ? !!result.discussList.length
                        : false;
                    if (result.currentPage == 1) {
                        result.discussList = result.discussList;
                    } else {
                        let others = result.discussList || [];
                        result.discussList = [
                            ...this.status.weiboList.discussList,
                            ...others
                        ];
                    }

                    this.status = { ...this.status, weiboList: result, loading: false };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };


    searchWeiboMainPageShareToMeList = params => {
        //ok
        let currentParams = { ...params, _func: "searchWeiboMainPageShareToMeList" };
        this.MYBLOG_LOADING(true, currentParams);
        Apis.getWeiboPageShareToMeList(params)
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });

                    result.__hasData = result.discussList
                        ? !!result.discussList.length
                        : false;
                    if (result.currentPage == 1) {
                        result.discussList = result.discussList;
                    } else {
                        let others = result.discussList || [];
                        result.discussList = [
                            ...this.status.weiboList.discussList,
                            ...others
                        ];
                    }
                    this.status = { ...this.status, weiboList: result, loading: false };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };



    searchWeiboMainPageAllList = params => {
        //ok
        let currentParams = { ...params, _func: "searchWeiboMainPageAllList" };
        this.MYBLOG_LOADING(true, currentParams);
        Apis.getAllWeiboMainPageList(params)
            .then(result => {
                if (isEqual(this.status.currentParams, currentParams)) {
                    let copyresult = { ...result };
                    copyresult.discussList.forEach((record, index) => {
                        if (record.content) {
                            let decodeContent = Base64.decode(record.content);
                            result.discussList[index] = { ...record, content: decodeContent };
                        }
                        if (record.blogReplyList && record.blogReplyList.length > 0) {
                            record.blogReplyList.forEach((_record, _index) => {
                                let decodeContentReply = Base64.decode(_record.content);
                                result.discussList[index].blogReplyList[_index] = {
                                    ..._record,
                                    content: decodeContentReply
                                };
                            });
                        }
                    });

                    result.__hasData = result.discussList
                        ? !!result.discussList.length
                        : false;
                    if (result.currentPage == 1) {
                        result.discussList = result.discussList;
                    } else {
                        let others = result.discussList || [];
                        result.discussList = [
                            ...this.status.weiboList.discussList,
                            ...others
                        ];
                    }
                    this.status = { ...this.status, weiboList: result, loading: false };
                }
            })
            .catch(error => {
                message.error(error);
            });
    };

    getSystemWorkLog = (params, others) => {
        Apis.getSystemWorkLog(params)
            .then(result => {
                // this.status = {...this.status,visitorList:result}
                let copyresult = { ...result };
                copyresult.sysWorkLog.forEach((record, index) => {
                    if (record.taskcontent) {
                        let decodeContent = Base64.decode(record.taskcontent);
                        result.sysWorkLog[index] = {
                            ...record,
                            taskcontent: decodeContent
                        };
                    }
                });
                this.replaceWeiboList(
                    others,
                    "sysWorkLog",
                    "sysWorkLog",
                    this.status,
                    result
                );
            })
            .catch(error => {
                message.error(error);
            });
    };

    editWeibo = (params, others, callback = false) => {
        //ok
        if (params.content) {
            message.loading(getLabel('384534',"正在提交中..."), 20);
            params.content = params.content.replace(GetRegex("wrap"), "");
            Apis.editWeibo(params)
                .then(result => {
                    this.cubeLayoutParame={};
                    if (result.status == "1") {
                        let copyresult = { ...result };
                        if (copyresult.blogDiscussVo.content) {
                            let decodeContent = Base64.decode(
                                copyresult.blogDiscussVo.content
                            );
                            result.blogDiscussVo = {
                                ...copyresult.blogDiscussVo,
                                content: decodeContent
                            };
                        }

                        if (
                            copyresult.blogDiscussVo.blogReplyList &&
                            copyresult.blogDiscussVo.blogReplyList.length > 0
                        ) {
                            copyresult.blogDiscussVo.blogReplyList.forEach(
                                (_record, _index) => {
                                    let decodeContentReply = Base64.decode(_record.content);
                                    result.blogDiscussVo.blogReplyList[_index] = {
                                        ..._record,
                                        content: decodeContentReply
                                    };
                                }
                            );
                        }
                        if(params.fromTag){
                            others = {...others,workdate:result.blogDiscussVo.workdate}
                        }


                        if(!result.istodaymany){
                            if(result.isNew){
                                others.workdate = result.blogDiscussVo.workdate;
                            }else{
                                others.discussId=result.blogDiscussVo.id;
                            }
                        }else{
                            others.istodaymany=result.istodaymany;
                        }


                        this.replaceWeiboList(
                            others,
                            "",
                            "blogDiscussVo",
                            this.status,
                            result,
                            "",
                            () => {callback(result);
                                this.disabled = false;

                            }
                        );



                        this.getIndexInfo(); // 刷新指数
                    } else {
                        message.destroy();
                        message.error(result.error);
                    }
                    // this.disabled = false;
                    // if (callback) callback(result)暂时去掉，改到replaceWeiboList里
                })
                .catch(error => {
                    message.error(error);
                    this.disabled = false;
                });
        } else {
            Modal.warning({ title: getLabel(127354,"警告"), content: getLabel('126982',"请填写内容") });
            Apis.getNull();
            this.disabled = false;
        }

    };

    editComment = (params, others, callback) => {
        //ok
        if (params.content) {
            message.loading(getLabel('384534',"正在提交中..."), 20);
            Apis.editComment(params)
                .then(result => {
                    if (result.status == "1") {
                        message.destroy();
                        message.success(getLabel('83885',"操作成功！"));
                        let copyresult = { ...result };
                        copyresult.blogReplyList.forEach((record, index) => {
                            if (record.content) {
                                let decodeContent = Base64.decode(record.content);
                                result.blogReplyList[index] = {
                                    ...record,
                                    content: decodeContent
                                };
                            }
                        });

                        others.discussId = result.discussId;
                        this.replaceWeiboList(
                            others,
                            "blogReplyList",
                            "blogReplyList",
                            this.status,
                            result
                        );
                    } else {
                        message.destroy();
                        message.error(getLabel('384535',"提交失败！"));
                    }
                    if (callback) callback(result);
                })
                .catch(error => {
                    message.warning(error);
                });
        } else {
            Modal.warning({ title: getLabel(127354,"警告"), content: getLabel('126982',"请填写内容") });
            Apis.getNull();
        }
    };

    deleteComment = (params, others) => {
        //ok
        Apis.deleteComment(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));

                let copyresult = { ...result };
                copyresult.replyList.forEach((record, index) => {
                    if (record.content) {
                        let decodeContent = Base64.decode(record.content);
                        result.replyList[index] = { ...record, content: decodeContent };
                    }
                });

                this.replaceWeiboList(
                    others,
                    "blogReplyList",
                    "replyList",
                    this.status,
                    result
                );
            })
            .catch(error => {
                message.warning(error);
            });
    };

    editAgree = (params, others) => {
        //ok
        Apis.editAgree(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                this.replaceWeiboList(
                    others,
                    "blogZanBean",
                    "blogZanBean",
                    this.status,
                    result
                );
            })
            .catch(error => {
                message.warning(error);
            });
    };

    getFanList = params => {
        this.MYBLOG_LOADING(true);
        Apis.getFanList(params)
            .then(result => {
                this.MYBLOG_LOADING(false);
                this.status = { ...this.status, fanList: result };
            })
            .catch(error => {
                message.error(error);
            });
    };





    getAttentionList = (params, callback) => {
        this.MYBLOG_LOADING(true);

        if(params.groupId=='special'){
            this.isSpecial = true;
        }else{
            this.isSpecial = false;
        }

        Apis.getAttentionList(params)
            .then(result => {

                this.MYBLOG_LOADING(false);
                this.status = { ...this.status, attentionList: result };

                if(params.groupId=="all"){
                    this.allCount=result.allCount;
                    this.specialCount = result.specialCount;
                }else if(params.groupId=='special'){
                    this.specialCount = result.specialCount;
                    this.allCount=result.allCount;
                }

                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    getShareToMeUserList = (params, callback) => {
        this.MYBLOG_LOADING(true);
        Apis.getShareToMeUserList(params)
            .then(result => {
                this.MYBLOG_LOADING(false);
                this.status = { ...this.status, shareToMeUserList: result };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };





    batchAttention = (parms) => {
        Apis.batchAttention(parms).then(result => {
                if(result.status=='1'){
                    message.success(getLabel(513792,'发送关注请求成功！'));
                }else {
                    message.success(getLabel(513793,'发送关注请求失败！') );
                }
            }
        )

    }



    getFilterIds = () => {
        Apis.outAttentionUsers().then(result => {
            this.status.gzbrowsercondition = result.ids;
        }).catch(error => {

        });
    }

    attentionListOnSelect = attentionList => {
        this.status = { ...this.status, attentionList: attentionList };
    };

    shareToMeUserListOnSelect = shareToMeUserList => {
        this.status = { ...this.status, shareToMeUserList: shareToMeUserList };
    };
    isCheckDis = isDis => {
        this.status = { ...this.status, bacthAttentionDisabled: isDis };
    };

    createGroup = (params, callback) => {
        Apis.createGroup(params)
            .then(result => {
                // this.status = {...this.status,attentionList:result}
                message.success(getLabel('83885',"操作成功！"));
                if (result.groupInfo.groupId) {
                    let weiboGroup = { ...this.status.weiboGroup };
                    weiboGroup.groupList.push(result.groupInfo);
                    this.status = { ...this.status, weiboGroup: weiboGroup };
                }
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    editGroup = (params, callback) => {
        Apis.editGroup(params)
            .then(result => {
                // this.status = {...this.status,attentionList:result}
                message.success(getLabel('83885',"操作成功！"));
                if (result.groupInfo.groupId) {
                    let weiboGroup = { ...this.status.weiboGroup };
                    weiboGroup.groupList.forEach((item, key) => {
                        if (item.groupId == params.groupId) {
                            weiboGroup.groupList[key] = result.groupInfo;
                            return;
                        }
                    });
                    this.status = { ...this.status, weiboGroup: weiboGroup };
                }
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    deleteGroup = (params, callback) => {
        Apis.deleteGroup(params)
            .then(result => {
                this.status = { ...this.status, weiboGroup: result };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    copyGroup = (params, callback) => {
        Apis.copyGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    moveGroup = (params, callback) => {
        Apis.moveGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    resetGroup = (params, callback) => {
        Apis.resetGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    removeGroup = (params, callback) => {
        Apis.removeGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    createAndMoveGroup = (params, callback) => {
        Apis.createAndMoveGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    createAndCopyGroup = (params, callback) => {
        Apis.createAndCopyGroup(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    editFan = (params, callback) => {
        Apis.editFan(params)
            .then(result => {
                // message.success("操作成功！")
                let fanList = { ...this.status.fanList };
                fanList.attnList.forEach((item, key) => {
                    if (item.userId == params.userId) {
                        fanList.attnList[key] = result.attnInfo;
                        return;
                    }
                });
                this.status = { ...this.status, fanList: fanList };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    addSpecialUsers = (params) => {
        Apis.addSpecialUsers(params).then(result => {
            message.success(getLabel('83885',"操作成功！"))
            let attentionList = { ...this.status.attentionList };
            attentionList.attentionList.forEach((item, key) => {
                if (item.userId == params.specids) {
                    attentionList.attentionList[key].specialStatus = "2";
                    return;
                }
            });
            this.status = { ...this.status, attentionList: attentionList };

        })
    }

    cancelSpecialUser = (params) => {
        Apis.cancelSpecialUsers(params).then(result => {
            message.success(getLabel('83885',"操作成功！"))
            let attentionList = { ...this.status.attentionList };
            attentionList.attentionList.forEach((item, key) => {
                if (item.userId == params.specids) {
                    attentionList.attentionList[key].specialStatus = "1";
                    return;
                }
            });
            this.status = { ...this.status, attentionList: attentionList };



        })
    }


    cancelSpecialUsers = (params) => {
        this.MYBLOG_LOADING(true);
        Apis.batchCancelSpecialUsers(params).then(result => {
            this.MYBLOG_LOADING(false);
            message.success(getLabel('83885',"操作成功！"))
            this.status = { ...this.status, attentionList: result };
            this.specialCount = result.specialCount;
            this.allCount = result.allCount;
        })
    }



    editAttition = (params, callback) => {
        Apis.editAttition(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                let attentionList = { ...this.status.attentionList };
                attentionList.attentionList.forEach((item, key) => {
                    if (item.userId == params.userId) {
                        attentionList.attentionList[key] = result.attnInfo;
                        return;
                    }
                });
                this.status = { ...this.status, attentionList: attentionList };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    editShareToMe = (params, callback) => {
        Apis.editAttition(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                let shareToMeUserList = { ...this.status.shareToMeUserList };
                shareToMeUserList.shareToMeUserList.forEach((item, key) => {
                    if (item.userId == params.userId) {
                        shareToMeUserList.shareToMeUserList[key] = result.attnInfo;
                        return;
                    }
                });
                this.status = { ...this.status, shareToMeUserList: shareToMeUserList };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    batchShareToMeAttention = ( callback) => {
        let data = this.status.shareToMeUserList.shareToMeUserList || [];
        let params = {};
        let islower="",userId="";
        let isState = false;
        data.forEach(
            item => {
                if (item.checked) {
                    userId += item.userId+","
                    islower += item.islower+","
                    if(item.attentionStatus!="3"){
                        isState=true;
                    }
                }

            }
        )
        if(isState){
            message.warning(getLabel('838851',"不能重复关注"));
            return;
        }
        params["userId"] =  userId;
        params["islower"] =  islower;
        Apis.batchAttentionOpt(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                let shareToMeUserList = { ...this.status.shareToMeUserList };
                result.attnInfo.forEach((item, key) => {
                    shareToMeUserList.shareToMeUserList.forEach((item1, key1) => {
                        if (item.userId == item1.userId) {
                            shareToMeUserList.shareToMeUserList[key1] = item;
                            return;
                        }
                    })
                });
                this.status.bacthAttentionDisabled=false;
                this.status = { ...this.status, shareToMeUserList: shareToMeUserList };
                if(result.status=="1"){
                    this.getBasicInfo();
                }
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };


    editAttitions = (params, callback) => {
        Apis.editAttitions(params)
            .then(result => {
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    getIsOneSubmitInfo = (callback)=>{
        Apis.getIsOneSubmitInfo({}).then(result => {
            if (callback) callback(result);
        })
        .catch(error => {
            message.error(error);
        });
    }

    getMessageList = params => {
        Apis.getMessageList(params)
            .then(result => {
                this.status = { ...this.status, messageList: result };
            })
            .catch(error => {
                message.error(error);
            });
    };

    ignoreMessage = (params, callback) => {
        Apis.ignoreMessage(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                result.remindList = [];
                this.status.messageList.remindList.forEach(item => {
                    if (item.id != params.id) {
                        result.remindList.push(item);
                    }
                });
                this.status = { ...this.status, messageList: result };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    ignoreMessages = callback => {
        Apis.ignoreMessages()
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                result.remindList = [];
                this.status = { ...this.status, messageList: result };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    approveMessage = (params, callback) => {
        Apis.approveMessage(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                result.remindList = [];
                this.status.messageList.remindList.forEach(item => {
                    if (item.id != params.id) {
                        result.remindList.push(item);
                    }
                });
                this.status = { ...this.status, messageList: result };
                if (callback) callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    };


    @observable
    showbdshare = 0;

    getNote = (params,callback,back) => {
        Apis.getNote(params)
            .then(result => {
                let decodeContent = Base64.decode(result.content);
                let copy = { ...result, content: decodeContent };
                this.status = { ...this.status, note: copy };
                this.notetime=result.notetime;
                this.notetiming=result.notetiming;
                if(result&&result.bdshare){
                    this.showbdshare = result.bdshare;
                }

                if(callback)callback(decodeContent);
                if(back)back(result);
            })
            .catch(error => {
                message.error(error);
            });
    };

    saveNote = (params, callback,auto) => {
        params.content = params.content.replace(GetRegex("wrap"), "");
        Apis.saveNote(params)
            .then(result => {
                if (callback) callback(result);
                if(!this.isNoTip){
                    if(params.workdate){
                        if(auto){
                            message.success(getLabel(520729,'草稿自动保存成功'));
                        }else{
                            message.success(`${getLabel(513813,'草稿保存成功！') }`);
                        }
                    }else{
                        message.success(`${getLabel(18758,'保存成功')}`);
                    }
                }
                this.isNoTip = false;
            })
            .catch(error => {
                this.isNoTip = false;
            });
           
    };

    setScore = params => {
        Apis.setScore(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                let copyresult = { ...result };
                if (copyresult.blogDiscussVo.content) {
                    let decodeContent = Base64.decode(copyresult.blogDiscussVo.content);
                    result.blogDiscussVo = {
                        ...copyresult.blogDiscussVo,
                        content: decodeContent
                    };
                }

                if (
                    copyresult.blogDiscussVo.blogReplyList &&
                    copyresult.blogDiscussVo.blogReplyList.length > 0
                ) {
                    copyresult.blogDiscussVo.blogReplyList.forEach((_record, _index) => {
                        let decodeContentReply = Base64.decode(_record.content);
                        result.blogDiscussVo.blogReplyList[_index] = {
                            ..._record,
                            content: decodeContentReply
                        };
                    });
                }

                this.replaceWeiboList(params, "", "blogDiscussVo", this.status, result);
            })
            .catch(error => {
                message.warning(error);
            });
    };

    remind(params, callback) {
        Apis.setNotice(params)
            .then(result => {
                message.info(getLabel('384538',"已发送提醒"));
                callback && callback(result);
            })
            .catch(error => {
                message.error(error);
            });
    }

    setNotice = params => {
        Apis.setNotice(params)
            .then(result => {
                message.success(getLabel('83885',"操作成功！"));
                // this.replaceWeiboList(params, "", "blogDiscussVo", this.status, result)
            })
            .catch(error => {
                message.warning(error);
            });
    };

    setReaded = (params, callback) => {
        //ok
        Apis.setReaded(params)
            .then(result => {
                this.replaceWeiboList(
                    params,
                    "",
                    "blogDiscussVo",
                    this.status,
                    result,
                    "setReaded"
                );
                if (callback) callback(result);
            })
            .catch(error => {
                message.warning(error);
            });
    };

    setModuleState = (params = {}) => {
        let moduleStatus = {...this.moduleStatus};
        Object.keys(params).forEach(key => {
            moduleStatus[key] = params[key];
        });
        this.moduleStatus = moduleStatus;
    }
    getBlogGroupAddCondition = params => {
        Apis.getBlogGroupAdd(params).then(result => {
            this.groupDialogForm.initFormFields(result.conditioninfo);
            this.moduleStatus.groupDialogFields = result.conditioninfo;
        }).catch(error => {
            message.warning(error);
        });
    };

}






// WEBPACK FOOTER //
// ./../src4js/pc4mobx/blog/stores/myBlog.js